package com.bgs.service.impl;

import com.bgs.mapper.AchievementsMapper;
import com.bgs.pojo.Achievements;
import com.bgs.service.AchievementsService;
import com.bgs.tool.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AchievementsServiceImpl implements AchievementsService {
    @Autowired
    private AchievementsMapper achievementsMapper;
    @Override
    public R select(Integer eid) {
        List<Achievements> list = achievementsMapper.select(eid);
        return R.ok().data("list",list);
    }

    @Override
    public R finish(Integer eid) {
        List<Achievements> list = achievementsMapper.finish(eid);
        return R.ok().data("list",list);
    }

    @Override
    public R undone(Integer eid) {
        List<Achievements> list = achievementsMapper.undone(eid);
        return R.ok().data("list",list);
    }

    @Override
    public R getByid(Integer aid) {
        List<Achievements> list = achievementsMapper.getByid(aid);
        return R.ok().data("list",list);
    }

    @Override
    public R comment(Achievements achievements) {
        int i = achievementsMapper.comment(achievements);
        return R.ok().data("i",i);
    }
}
